//
//  MYGNewsTopCollectionViewCell.swift
//  MYDoctor
//
//  Created by Mo on 2024/3/6.
//

import UIKit

class MYGNewsTopCollectionViewCell: UICollectionViewCell {
    var contentImageV:UIImageView!
    var playBtn:UIButton!
    var modelDa:MYGNewsModel = MYGNewsModel(){
        didSet{
            contentImageV.sd_setImage(with: URL(string: modelDa.img))
        }
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = .clear
        self.layer.masksToBounds = true
        self.layer.cornerRadius = 5
        
        contentImageV = UIImageView()
        contentImageV.contentMode = .scaleAspectFill
        self.contentView.addSubview(contentImageV)
        contentImageV.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        
        playBtn = UIButton()
        playBtn.setImage(UIImage(named: "MYG_home_play"), for: .normal)
        self.contentView.addSubview(playBtn)
        playBtn.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.width.height.equalTo(24)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
